//const BASE_URL = 'https://wx.kfsc.club/v1'   
const BASE_URL = 'http://127.0.0.1:9010/v1' 
const request = (options) => {
	return new Promise((reslove, reject) => {
		uni.request({
			url: BASE_URL + options.url,
			method: options.method || 'GET',
			data: options.data || {},
			header:options.header || {authorization:uni.getStorageSync('authorization')},
			success: (res) => {
				if (res.data.code == -1) {
					return uni.showToast({
						title: res.data.message
					})
				}
				reslove(res)
			},
			fail:(err)=> {
				uni.showToast({
					title: "请求接口失败"
				})
				reject(err)
			}
		})
	})
}
module.exports={
	request
}